<include file="__PUBLIC__/header"/>
<body>

<div class="hd-menu-list">
    <ul>
        <li class="active"><a href="{|addon_url:index}">地址列表</a></li>
        <li><a href="{|addon_url:add}">添加地址</a></li>
    </ul>

<input class="hd-w200" type="text" placeholder="请输入地址..." value="" name="sou_ip">

<button class="hd-btn hd-btn-xm"  id="sou">搜索</button>

</div> 

<form action="{|addon_url:del}" method="post">
<table class="hd-table hd-table-list hd-form">
    <thead>
    <tr>
    <td class="hd-w30">
        <input type="checkbox" id="selectAllContent"/>
        </td>
        <td class="hd-w50">id</td>
        <td class="hd-w50">省份</td>
        <td class="hd-w50">城市</td>
        <td class="hd-w60">操作</td>
    </tr>
    </thead>
  <tbody>
    <list from="$address" name="$d">
  
        <tr>
        
        <td><input type="checkbox" name="id[]" value="{$d.id}"/></td>
            <td>{$d.id}</td>
            <td>{$d.sheng}</td>
            <td>{$d.city}</td>
           
            <td><a href="{|addon_url:'del',array('id'=>$d['id'])}">删除</a></td>
        </tr>

    </list>
    </tbody>
    </table>
    <br>
    <input type="submit" class="hd-btn hd-btn-xm"  value="批量删除"/>
        </form>

<script type="text/javascript">
    //全选
            $("input#selectAllContent").click(function () {
                $("[type='checkbox']").attr("checked", $(this).attr("checked") == "checked");
            });

     $("#sou").click(function(){
          var sip = $("input[name=sou_ip]").val();
                            $.ajax({
                            url:"{|addon_url:sou}",
                            data:{sou_ip:sip},
                            dataType:"json",
                            success:function(ok){
                            $("tbody").html(ok)
                            }
               })
            })

           
          
</script>
</body>
</html>